﻿using msBsc.AppLogic.DataAlc;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace msBsc.WebUi.wMall.Public
{
    public partial class wfDirectionsList : msBsc.Cls.BPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        //获取路线
        private void GetScenicList()
        {

            string destionId = this.GetParamHtValue("destionId");
            string pIndex = this.GetParamHtValue("pIndex");

            int pNum = 1;
            int.TryParse(pIndex, out pNum);
            using (CBizDjkRouteBaseinfo routBaseInfo = new CBizDjkRouteBaseinfo())
            {
                DataSet dsRouts = routBaseInfo.GetDestionRouts(destionId,8, pNum);
                if (dsRouts == null || dsRouts.Tables[0].Rows.Count < 1)
                {
                    this.ExecJScript("$('#route_list').html('<li>没有该地区下的路线信息<li/>');");
                    return;
                }

                string strJson = msBsc.AppLogic.Cfg.HttpTools.GetJsonByTable(dsRouts.Tables[0], "", "", 1,8, "");
                this.ExecJScript(@"loadRoutHtml(" + strJson + "," + dsRouts.Tables[0].Rows[0]["DATACOUNT"] + ")");
            }
        }

        public override void DoAction()
        {
            if (this.strAction == "init")
            {
                GetScenicList();
            }
            else if (this.strAction == "getroute")
            {
                
            }
        }
    }
}